package com.microsight.wuyou.ui

import android.os.Bundle
import android.view.ViewGroup
import com.microsight.wuyou.R

/**
 * Class description:
 *
 * @author zlp
 * @version 1.0
 * @see SplashAdActivity
 */
class SplashAdActivity : BaseActivity() {

    companion object {
        private const val SPLASH_LOAD_TIMEOUT = 3000
    }

    private lateinit var adContainer: ViewGroup

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_splash)
        this.adContainer = findViewById(R.id.ad_container)

//        val instance = AdSdk.getInstance()
//        instance.loadSplashAd(
//                this,
//                "s1",
//                adContainer,
//                SPLASH_LOAD_TIMEOUT,
//                this
//        )
        finish()
    }

    private var pause = false

    override fun onPause() {
        super.onPause()
        pause = true
    }

    override fun onResume() {
        super.onResume()
        if (pause) {
            finish()
        }
        pause = false
    }
}